#pragma once
#include <i_misc.h>
#include <string>

namespace dll
{
	struct IDllFile
	{
		virtual bool LoadFile(const std::string& path) = 0;

		virtual bool GetEntery(const char* name, void** fun_ptr) = 0;

		template<class T>
		bool GetEntery(const char* name, T*& fun_ptr)
		{
			return GetEntery(name, &(void*&)fun_ptr);
		}

		virtual void Close() = 0;

		virtual const std::string& LastError() = 0;
	};

	typedef std::shared_ptr<IDllFile> IDllFilePtr;

	MISC_DLL_EXPORT IDllFilePtr CreateDllFile();
}
